package com.bcxj.apidriver.service;

import com.bcxj.apidriver.client.ServiceOrderClient;
import com.bcxj.internalcommon.constant.IdentityConstant;
import com.bcxj.internalcommon.dto.OrderRequest;
import com.bcxj.internalcommon.dto.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * ClassName: ApiDriverOrderService
 * Package: com.bcxj.apidriver.service
 * Description:
 *
 * @Author BCXJ
 * @Create 2024/11/23 22:11
 * @Version 1.0
 * @Since 1.0
 */
@Service
public class ApiDriverOrderService {

    @Autowired
    private ServiceOrderClient serviceOrderClient;

    /**
     * 司机去接乘客
     * @param orderRequest
     * @return
     */
    public ResponseResult toPickUpPassenger(OrderRequest orderRequest) {
        return serviceOrderClient.toPickUpPassenger(orderRequest);
    }

    /**
     * 司机到达出发点
     * @param orderRequest
     * @return
     */
    public ResponseResult arrivedDeparture(OrderRequest orderRequest) {
        return serviceOrderClient.arrivedDeparture(orderRequest);
    }


    /**
     * 司机接到乘客
     * @param orderRequest
     * @return
     */
    public ResponseResult pickUpPassenger(OrderRequest orderRequest) {
        return serviceOrderClient.pickUpPassenger(orderRequest);
    }

    /**
     * 乘客到达目的地/乘客下车
     * @param orderRequest
     * @return
     */
    public ResponseResult orderGetoff(OrderRequest orderRequest) {
        return serviceOrderClient.orderGetoff(orderRequest);
    }

    /**
     * 乘客取消订单
     * @param orderId
     * @return
     */
    public ResponseResult cancel(String orderId) {
        return serviceOrderClient.cancel(orderId, IdentityConstant.DRIVER_IDENTITY);
    }
}
